<?php $this->load->module('mobile/index/header', $common); ?>
<style>
    .ctitle{
        height:1.5rem;
        text-align: left;
        background-color: #349cd1;
        float: left;
        color: #ffffff;
        margin: 1.5rem auto;
        /* position: absolute; */
        /* left: 0; */
        display: block;
        font-size:15px;
        clear: both;
        padding-left: 50px;
        padding-right: 10px;
    }
    .jqxc{clear:both}
    .xiangqing-txt{
        width: 80%;
        clear: both;
        font-size: 0.5rem;
    }
    .xiangqing-txt p{
        color: #717172;
        font-size: 0.5rem;
    }
    .xiangqing-txt span{
        color: #349cd1;
    }
    .xiangqing-txt b{
        color: #349cd1;
    }
    .linedashed{
        width: 100%;
        margin: 0.5rem auto;
        height: 0.1rem;
        border-bottom: dashed 1px #9e9e9e;
        clear: both;
    }
    .xiangqing-txt img{
        width: 100%;
    }
</style>

    <div class="wrap">
        <div class="container">
            <div class="jdxqbar">
                <img class="imgbg" src="<?php echo filter_img($car['thumb']); ?>" data-original="<?php echo filter_img($car['thumb']); ?>">
                <div class="jdxqbartag">
                    <p> <?php echo $car['title']; ?></p>
                    <span><?php echo $car['brand']; ?></span>
                </div>
            </div>
            <div class="jdxqtitle">
                <div class="jdxqtitle1 cl">
                    <div class="jdxqtitle-left">
                        <p> <?php echo $car['title']; ?></p>
                        <span><?php echo $cartypo[$car['car_type']]; ?></span>
                    </div>
                    <div class="jdxqtitle-right">
                        <div class="zxsc">
                            <a href="tel:<?php echo $site_service_phone?>">
                                <img class="img1" src="img/zx.png" data-original="img/zx.png"></a>
                            <a><img class="img2" id="js-add-favourite" src="img/sc.png" data-original="img/sc.png"></a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="jdxqprice">
                <div class="price">
<?php foreach($car['price_list'] as $k=>$v):?>
                    <small>促销价：</small> <strong><?php echo sprintf('%.2f', $v['ws_price']);?></strong>
    <?php if($v['price_unit']=='1'):?><small>元/次</small><?php endif;?><?php if($v['price_unit']=='2'):?><small>元/天</small><?php endif;?>
    <?php
    break;
endforeach;?>
                </div>
                <div class="ljydbtn">
                    <?php if(!ADMINID && $car['price_list']){?>
                        <a href="<?php echo site_url('mobile/rent/order?id=' . $car['id'] . '&referer=' . urlencode($_SERVER['REQUEST_URI'])) ?>">
                        <span class="paybtn">立即预定</span>
                        </a>
                    <?php }else if(!ADMINID){?>
                        <a href="tel:<?php echo $site_service_phone?>">
                        <span class="paybtn">电询</span>
                        </a>
                    <?php }?>

                </div>
            </div>
            <div class="container">
                <div class="jdxqbioati">
                    <img src="img/xc.png" data-original="img/xc.png">
                    <span>车辆简介</span>
                </div>
                <h1 class="ctitle">车型介绍</h1>
                <div class="xiangqing-txt">
                    <p><b>车辆款式</b>&nbsp;<?php echo $cartypo[$car['car_type']]?></p>
                    <div class="linedashed"></div>
                    <p><b>租金形式</b>&nbsp;    <?php if($v['price_unit']=='1'):?><small>元/次</small><?php endif;?><?php if($v['price_unit']=='2'):?><small>元/天</small><?php endif;?></p>
                    <div class="linedashed"></div>
                    <p><b>可载人数</b>&nbsp;<?php echo $seat[$car['seat']]?></p>
                    <div class="linedashed"></div>
                    <p><b>保险情况</b>&nbsp;<?php echo $car['insurance']?></p>
                    <div class="linedashed"></div>
                    <p><b>服务类型</b>&nbsp;
<?php if($car[long_service]){?>旅游包车、<?php }?>
<?php if($car[short_service]){?>短线包车、<?php }?>
<?php if($car[airport_service]){?>机场接送服务<?php }?>
                    </p>
                    <p><b>备注</b>&nbsp;
                    <?php echo nl2br(trim($car['desc'])) ?>
                        <img src="<?php echo filter_img($car['thumb']); ?>" data-original="<?php echo filter_img($car['thumb']); ?>">
                    </p>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        $(function(){

            var url = '<?php echo site_url('mobile/member/add_favourite');?>';
            var id = '<?php echo $car['id']; ?>';
            var title = '<?php echo $car['title']; ?>';
            var cover = '<?php echo urlencode(($car['thumb']));?>';
            $('#js-add-favourite').click(function(){

                if(!(ADMINID||USERID)){
                    $.dialog({
                        style:'tip',
                        width:200,
                        closeTime:1000,
                        content: '<p style="text-align: center">您还没有登录,不能收藏</p>'
                    }).open();
                    return false;
                }

                $.get(url+(url.indexOf("?") > -1 ? "&" : "?")+'type=3&id='+id+'&title='+title+'&cover='+cover, function(data){

                    if(data.status.length>0){
                        $.dialog({
                            style:'tip',
                            width:200,
                            closeTime:1000,
                            content: '<p style="text-align: center">'+data.msg+'</p>'
                        }).open();
                    }

                },'json');
            });

        })
    </script>
<?php $this->load->module('mobile/index/footer', $common); ?>